#文章管理的model
config = require('../config')
Schema = config.Schema
mongoose = config.mongoose

ImageSchema = new Schema({
  title : {type:String,required:true},
  code : {type:String,required:true},
  image_file_id : {type:String,required:true},
  update_at : Date
})


ImageSchema.methods.add = (req,cb) ->
  this.title = req.param('title')
  this.code = req.param('code')
  this.image_file_id = req.param('image_file_id')
  this.update_at = new Date
  this.save cb


#exports.PurIntent = modeldb.model 'PurIntent', PurIntentSchema
exports.Image = mongoose.model 'Image', ImageSchema